package com.kehutong.work.order.manage.entity;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;

import org.coraframework.orm.Entity;
import org.coraframework.orm.annotation.Column;
import org.coraframework.orm.annotation.Table;
import org.coraframework.orm.util.IDType;
import org.coraframework.util.Objects;

import com.kehutong.work.order.manage.enums.WorkOrderHandleStateEnum;

@Table(value="t_work_order_manage_record", comment="工单记录", multi=true, idType = IDType.TIMESTAMP)
public class WorkOrderManageRecord extends Entity {

    private static final long serialVersionUID = -2796962217074142912L;

    protected WorkOrderManageRecord(String id) {
        super(id);
    }

    @Column(comment = "工单ID")
    private String workOrderId;

    @Column(comment = "上一条工单记录ID")
    private String parentRecordId;

    @Column(comment = "当前状态")
    private WorkOrderHandleStateEnum handleState;

    @Column(comment = "工单标题")
    private String name;

    @Column(comment = "备注")
    private String remark;

    @Column(comment = "上一个创建时间")
    private Timestamp lastCreateTime;

    @Column(comment = "签到地点", length = 144)
    private String address;

    @Column(comment = "经度")
    private String lng;

    @Column(comment = "纬度")
    private String lat;

    @Column(comment = "下一个处理人员ID", length = 255)
    private String nextEmployeeNo;

    @Column(comment = "下一个处理人员名字", length = 255)
    private String nextEmployeeName;

    @Column(comment = "处理人员ID", length = 255)
    private String handleEmployeeNo;

    @Column(comment = "处理人员名字", length = 255)
    private String handleEmployeeName;

    @Column(comment = "处理人岗位名称", length = 255)
    private String handlePositionTitle;

    @Column(comment = "创建人头像", length = 255)
    private String avatar;

    @Column(comment = "是否是节点")
    private boolean node;

    @Column(comment = "是否是用户")
    private boolean userCreate;

    @Column(comment="图片列表")
    private List<String> imgIds;

    public String getWorkOrderId() {
        return workOrderId;
    }

    public void setWorkOrderId(String workOrderId) {
        this.workOrderId = workOrderId;
    }

    public WorkOrderHandleStateEnum getHandleState() {
        return handleState;
    }

    public String getParentRecordId() {
        return parentRecordId;
    }

    public void setParentRecordId(String parentRecordId) {
        this.parentRecordId = parentRecordId;
    }

    public void setHandleState(WorkOrderHandleStateEnum handleState) {
        this.handleState = handleState;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Timestamp getLastCreateTime() {
        return lastCreateTime;
    }

    public void setLastCreateTime(Timestamp lastCreateTime) {
        this.lastCreateTime = lastCreateTime;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getLng() {
        return lng;
    }

    public void setLng(String lng) {
        this.lng = lng;
    }

    public String getLat() {
        return lat;
    }

    public void setLat(String lat) {
        this.lat = lat;
    }

    public String getNextEmployeeNo() {
        return nextEmployeeNo;
    }

    public void setNextEmployeeNo(String nextEmployeeNo) {
        this.nextEmployeeNo = nextEmployeeNo;
    }

    public String getNextEmployeeName() {
        return nextEmployeeName;
    }

    public void setNextEmployeeName(String nextEmployeeName) {
        this.nextEmployeeName = nextEmployeeName;
    }

    public String getHandleEmployeeNo() {
        return handleEmployeeNo;
    }

    public void setHandleEmployeeNo(String handleEmployeeNo) {
        this.handleEmployeeNo = handleEmployeeNo;
    }

    public String getHandleEmployeeName() {
        return handleEmployeeName;
    }

    public void setHandleEmployeeName(String handleEmployeeName) {
        this.handleEmployeeName = handleEmployeeName;
    }

    public boolean isNode() {
        return node;
    }

    public void setNode(boolean node) {
        this.node = node;
    }

    public boolean isUserCreate() {
        return userCreate;
    }

    public void setUserCreate(boolean userCreate) {
        this.userCreate = userCreate;
    }

    public List<String> getImgIds() {
        if (Objects.isEmpty(imgIds)) {
            return new ArrayList<>();
        }
        return imgIds;
    }

    public void setImgIds(List<String> imgIds) {
        this.imgIds = imgIds;
    }

    public String getHandlePositionTitle() {
        return handlePositionTitle;
    }

    public void setHandlePositionTitle(String handlePositionTitle) {
        this.handlePositionTitle = handlePositionTitle;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }
}
